<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>教师信息编辑</title>
<script type="text/javascript">

	function fh() {
		teacher();
	}
	
	
	function jy(form) {
		
		var name = form.name.value;
		var username = form.username.value;	
		if(name.length==0){
			alert("请输入教师姓名！");
			return false;	
		}
		
		if(username.length==0){
			alert("请输入教师账号！");
			return false;
		}
		
		if(!(/^[A-Za-z0-9]+$/.test(username))){
			alert("用户名只能由字母，数字组成！");
			return false;
		}
		
		return true;
	}
		
	
</script>
<style type="text/css">

	body{
		width:auto;
		height: auto;
		background-repeat:no-repeat;
		background-size: 100%;
		}	
		

	.sss{
		margin: 150px auto;
		border: 1px solid #cad9ea;
		padding-bottom: 15px;
		padding-left: 10px;
		padding-right: 10px;
		width:240px;
	}
	form p label{
		display:inline-block;
		width:80px;
		text-align: right;
	}
	
	input{
		padding: 6px;
	}
	
	form button{
		float:right;
	}
	
	button{
		width:60px;
		margin-left:2px;
		margin-bottom: 3px;
	}
</style>
</head>
<body>
	<div class="sss">
	<h3 style="text-align: center">编辑</h3>
	<form action="teacher?method=save" method="post" onsubmit="return jy(this)">
	<input type="hidden" name="id" value="${model.id}">
	<p><label>教师姓名：</label><input type="text" name="name" value="${model.name}"></p>
	<input type="hidden" name="password" value="${model.password}">
	<p><label>教师账号：</label><input type="text" name="username" value="${model.username}"></p>
	<p> <button type="reset">重置</button> <button type="submit">提交</button></p>
	</form>
	<button onclick="fh()">返回</button>
	</div>
</body>
</html>